package com.xbe.configManagement.controller;

import com.xbe.common.core.controller.BaseController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/** 受控库管理 */
@Controller
@RequestMapping("/config/controlled")
public class ConfigControlledController extends BaseController {
  private String prefix = "configuration/controlled";

  @GetMapping()
  public String user() {
    return prefix + "/list";
  }

  @GetMapping("/treeData")
  @ResponseBody
  public List<Map> treeData() {
    // List<Ztree> ztrees = deptService.selectDeptTree(new SysDept());
    List<Map> ztrees = new ArrayList<>();
    Map map = new HashMap();
    map.put("id", 100);
    map.put("pId", 0);
    map.put("name", "配置项文件目录");
    map.put("title", "配置项文件目录");
    map.put("checked", false);
    map.put("open", false);
    map.put("nocheck", false);

    Map map1 = new HashMap();
    map1.put("id", 101);
    map1.put("pId", 100);
    map1.put("name", "工程文档");
    map1.put("title", "工程文档");
    map1.put("checked", false);
    map1.put("open", false);
    map1.put("nocheck", false);

    Map map2 = new HashMap();
    map2.put("id", 102);
    map2.put("pId", 100);
    map2.put("name", "项目文档");
    map2.put("title", "项目文档");
    map2.put("checked", false);
    map2.put("open", false);
    map2.put("nocheck", false);

    Map map3 = new HashMap();
    map3.put("id", 103);
    map3.put("pId", 101);
    map3.put("name", "项目立项");
    map3.put("title", "项目立项");
    map3.put("checked", false);
    map3.put("open", false);
    map3.put("nocheck", false);

    Map map4 = new HashMap();
    map4.put("id", 104);
    map4.put("pId", 101);
    map4.put("name", "软件需求");
    map4.put("title", "软件需求");
    map4.put("checked", false);
    map4.put("open", false);
    map4.put("nocheck", false);

    Map map5 = new HashMap();
    map5.put("id", 105);
    map5.put("pId", 101);
    map5.put("name", "软件设计");
    map5.put("title", "软件设计");
    map5.put("checked", false);
    map5.put("open", false);
    map5.put("nocheck", false);

    Map map6 = new HashMap();
    map6.put("id", 106);
    map6.put("pId", 101);
    map6.put("name", "软件测试");
    map6.put("title", "软件测试");
    map6.put("checked", false);
    map6.put("open", false);
    map6.put("nocheck", false);

    Map map7 = new HashMap();
    map7.put("id", 107);
    map7.put("pId", 101);
    map7.put("name", "软件交付");
    map7.put("title", "软件交付");
    Map map8 = new HashMap();
    map8.put("id", 108);
    map8.put("pId", 101);
    map8.put("name", "软件交付");
    map8.put("title", "软件交付");

    Map map9 = new HashMap();
    map9.put("id", 108);
    map9.put("pId", 102);
    map9.put("name", "受控库配置状态报告");
    map9.put("title", "受控库配置状态报告");

    Map map10 = new HashMap();
    map10.put("id", 109);
    map10.put("pId", 102);
    map10.put("name", "产品库配置状态报告");
    map10.put("title", "产品库配置状态报告");

    ztrees.add(map);
    ztrees.add(map1);
    ztrees.add(map2);
    ztrees.add(map3);
    ztrees.add(map4);
    ztrees.add(map5);
    ztrees.add(map6);
    ztrees.add(map7);
    ztrees.add(map8);
    ztrees.add(map9);
    ztrees.add(map10);

    return ztrees;
  }
}
